<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html">
    <h:form>
        <h:outputText style="font-weight: bold" value="Choose a quotation to edit from the table below:" />
        <h:selectOneMenu value="#{quotationBean.quotationId}">
            <f:selectItems value="#{quotationBean.quotationList}" var="q"
                           itemLabel="#{q.id}" itemValue="#{q.id}" />
        </h:selectOneMenu>

        <br/><br/>
        <h:commandButton action="index.xhtml" value="Return to index" />
        <br/><br/>
        <h:commandButton action="editQuotation.xhtml" value="Proceed" actionListener="#{quotationBean.chooseQuotation}"/>
        <br/>
        <br/>
        <h:dataTable cellpadding="5px" cellspacing="16px" styleClass="allaroundborder" headerClass="allaroundborder" columnClasses="allaroundborder"
                     rowClasses="allaroundborder" value="#{quotationBean.quotationList}" var="quotation">

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Quotation Id" />
                </f:facet>
                <h:outputText value="#{quotation.id}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Issuance Date and Time" />
                </f:facet>
                <h:outputText value="#{quotation.dateTime}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Days of Validity" />
                </f:facet>
                <h:outputText value="#{quotation.daysValid}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Indicative Lead Time" />
                </f:facet>
                <h:outputText value="#{quotation.indicativeLeadTime}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Client ID" />
                </f:facet>
                <h:outputText value="#{quotation.client.id}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Status of Quotation" />
                </f:facet>
                <h:outputText value="#{quotation.status}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Last Modified By" />
                </f:facet>
                <h:outputText value="#{quotation.lastModifiedBy}" />
            </h:column>
        </h:dataTable>

    </h:form>
</ui:composition>
